package src.main.java.org.thread;
/*
* 1.让子类继承Thread线程类
* */
public class MyThread extends Thread{
    //2.必须重写Thread的run方法
    public MyThread(String name){
        super(name); //为线程设置名字
    }
    @Override
    public void run() {
        //描述线程的执行任务
        for (int i = 0; i < 5; i++) {
            System.out.println("MyThread线程输出："+i);
        }
    }
}
